<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    // abs 取绝对值
    console.log(Math.abs(4))  // 4
    console.log(Math.abs(-4)) // 4

    // ceil向上取整
    console.log(Math.ceil(3.7)) // 4
    console.log(Math.ceil(3.00001)) // 4
    console.log(Math.ceil(-3.00001)) // -3

    // floor向下取整
    console.log(Math.floor(3.7)) // 3
    console.log(Math.floor(3.00001)) // 3
    console.log(Math.floor(-3.00001)) // -4

    // round 四舍五入
    console.log(Math.round(3.6)) // 4
    console.log(Math.round(3.3)) // 3
    console.log(Math.round(-3.6)) // -4
    console.log(Math.round(-3.3)) // -3
    console.log(Math.round(-3.5)) // -3

    

  </script>
</body>
</html>